#ifndef ROTATESTATE
#define ROTATESTATE

#include <base\vec3f.h>
#include <app\states\sessionState.h>
#include <render\observers\rotateObserver.h>

#include <boost/signal.hpp>
#include <boost/bind.hpp>

#include <string>
#include <sstream>
#include <iostream>

using namespace std;

class rotateState : public sessionState, rotateObserver {

  static int class_type_id;
  int type_id;

private:

  vec3f new_rotation;
  vec3f shared_rotation;

  boost::signal3<void, const float &, const float &, const float &> rotate_sig;
  bool rotated; ///< indicate the rotation has changed

public:

  static sessionState *create();

  void addRotateObserver(rotateObserver *ref);
  virtual void rotate(const float x, const float y, const float z);
  
  void pickSharedRotation();
  vec3f getSharedRotation() const;

  static int getClassTypeId();
  virtual int getTypeId();

  rotateState();
  virtual ~rotateState();
};

#endif